home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_11_12 / kauffman / debug.h < prev   
C/C++ Source or Header  |  1993-10-20  |  711b  |  39 lines

  1. Listing 1 (debug.h)
  2. ===================
  3.  
  4. class MyDebugStreambuf : public strstreambuf
  5. {
  6. public:
  7.         MyDebugStreambuf( BOOL UseMessageBox,
  8.               char* pTitle );
  9.         ~MyDebugStreambuf()
  10.     {
  11.         delete [];
  12.     }
  13.     virtual int overflow( int ch );
  14.     virtual int sync();
  15. protected:
  16.     void Flush();
  17.  
  18.     BOOL m_UseMessageBox;
  19.     char* m_pTitle;
  20.     unsigned m_BufferSize;
  21.     char* m_pBuffer;
  22. };
  23.  
  24. class MyDebugStream : public ostream
  25. {
  26. public:
  27.         MyDebugStream( BOOL UseMessageBox = FALSE,
  28.                char* pTitle = NULL );
  29. protected:
  30.     MyDebugStreambuf m_buf;
  31. };
  32.  
  33. #define FLUSH_TO_BOX    0x01
  34. #define FLUSH_TO_DEBUG    0x02
  35.  
  36. ostream& BoxFlush( ostream& os );
  37.  
  38. ostream& DebugFlush( ostream& os );
  39.